﻿/*
 * KLF Headless Browser
 * Written by Kris Oye <kristianoye@gmail.com>
 * Copyright (C) 2011-2012.  All rights reserved.
 */
namespace KLF.Lib.Browser.DOM.HTML
{
    #region Using Statements

    using System;

    #endregion

    /// <summary>
    /// Preformatted text. See the PRE element definition in HTML 4.01.
    /// </summary>
    public class HTMLHRElement : HTMLBlockBaseElement
    {
        #region Constructors

        internal HTMLHRElement(Document owner)
            : base(owner, HTMLConstants.HTML_TAG_HR)
        {
        }

        #endregion

        #region DOM Level 2 HTML Compliance

        /// <summary>
        /// Indicates to the user agent that there should be no shading in the
        /// rendering of this element. See the noshade attribute definition in
        /// HTML 4.01. This attribute is deprecated in HTML 4.01.
        /// </summary>
        [Obsolete]
        public bool noShade
        {
            get
            {
                return getAttributeAsType<bool>(HTMLConstants.HTML_ATT_NOSHADE, false);
            }
            set
            {
                setAttributeAsType<bool>(HTMLConstants.HTML_ATT_NOSHADE, value);
            }
        }

        /// <summary>
        /// The height of the rule. See the size attribute definition in 
        /// HTML 4.01. This attribute is deprecated in HTML 4.01.
        /// </summary>
        [Obsolete]
        public string size
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_SIZE);
            }
            set
            {
                if (String.IsNullOrEmpty(value))
                    removeAttribute(HTMLConstants.HTML_ATT_SIZE);
                else
                    setAttribute(HTMLConstants.HTML_ATT_SIZE, value);
            }
        }

        /// <summary>
        /// The width of the rule. See the width attribute definition in 
        /// HTML 4.01. This attribute is deprecated in HTML 4.01.
        /// </summary>
        [Obsolete]
        public string width
        {
            get
            {
                return getAttribute(HTMLConstants.HTML_ATT_WIDTH);
            }
            set
            {
                if (String.IsNullOrEmpty(value))
                    removeAttribute(HTMLConstants.HTML_ATT_WIDTH);
                else
                    setAttribute(HTMLConstants.HTML_ATT_WIDTH, value);
            }
        }

        #endregion
    }
}
